#!/bin/bash
# Created by http://halucok.me
# Modified by 0123456

red='\e[1;31m'
blue='\e[1;34m'
green='\e[0;32m'
NC='\e[0m'
echo "CONNECTING TO SERVER..."
sleep 0.5
echo "MENGECEK PERMINTAAN..."
sleep 0.4
CEK=0123456
if [ "$CEK" != "0123456" ]; then
		echo -e "${red}PERMINTAAN DITOLAK!${NC}";
        echo $CEK;
        exit 0;
else
echo -e "${green}PERMINTAAN DITERIMAH...${NC}"
sleep 1
clear
fi
clear
echo " "
echo " "
echo " "
read -p "Masukkan USERNAME Untuk Ganti PASSWORD: " username
egrep "^$username" /etc/passwd >/dev/null
if [ $? -eq 0 ]; then
read -p "Masukkan PASSWORD Baru Untuk USER $username: " password

clear
echo "CONNECTING TO SERVER..."
sleep 0.5
echo "MEMBUAT PASSWORD BARU..."
sleep 0.5
  egrep "^$username" /etc/passwd >/dev/null
  echo -e "$password\n$password" | passwd $username
  clear
  echo " "
  echo " "
  echo " "
  echo "-------------------------------------------"
  echo -e "PASSWORD UNTUK USER ${blue}$username${NC} SUKSES DIGANTI."
  echo -e "PASSWORD BARU UNTUK USER ${blue}$username${NC} 👉 ${green}$password${NC}"
  echo "-------------------------------------------"
  echo " "
  echo " "
  echo " "

else
echo " "
echo -e "Username ${red}$username${NC} not found in your VPS"
echo " "
exit 0
fi
